<!doctype html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>{$article.title}-{$site_config.site_title}</title>
	<meta name="keywords" content="{$site_config.seo_keyword}">
	<meta name="description" content="{$site_config.seo_description}">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<link rel="icon" type="image/x-icon" href="/80629093830.png" />
	<link href="__public__css/base.css" rel="stylesheet">
	<link href="__public__css/index.css" rel="stylesheet">
	<link href="__public__css/info.css" rel="stylesheet">
	<link href="__public__css/m.css" rel="stylesheet">
	<link href="__public__css/share.min.css" rel="stylesheet">
	<link href="__public__css/common.css" rel="stylesheet">
	<link rel="stylesheet" href="/public/static/layui/css/layui.css" media="all">
	<style>
		code {
			display: inline-block;
			background-color: #f1f1f1;
			border-radius: 3px;
			padding: 3px 5px;
			margin: 0 3px;
		}
	</style>
</head>
<body>
{include file="/header/header"}
<article>
	<main>
		<div class="infosbox">
			<div class="newsview">
				<h3 class="news_title">{$article.title}</h3>
				<div class="bloginfo">
					<ul>
						<li class="author">
							作者：{$article.author}</li>
						<li class="lmname">码铁博客</li>
						<li class="timer">{$article.publish_time}</li>
						<li class="view">({$article.reading})人已阅读</li>
					</ul>
				</div>
				<div class="tags">
					{if condition="$em neq 1"}
						{foreach name="k_tags" item="vo"}
						<a href="/index/so/index.html?key={$vo.ta_name}" target="_blank">{$vo.ta_name}</a> &nbsp;
						{/foreach}
					{/if}
				</div>
				<br/>
				<div class="news_content">
					{php}echo $article['content'];{/php}
				</div>
				<div class="share">
					<div id="share" class="social-share" data-disabled="google,twitter,facebook,diandian"></div>
				</div>
			</div>
			</div>
			<div class="nextinfo">
				<p>上一篇：{$prevs.title? '<a href="'.url('article/index','id='.$prevs['id']).'">'.$prevs.title.'</a>' : '没有了'}</p>
				<p>下一篇：{$nexts.title? '<a href="'.url('article/index','id='.$nexts['id']).'">'.$nexts.title.'</a>' : '没有了'}</p>
			</div>
			<div class="news_pl">
				<div style="width:100px;float: left"><h2>文章评论</h2></div>
				<div class="reply-comments"><a href="javascript:;" onclick="test({$article.id},0,0)"><h2>评论</h2></a></div>
				<div style="clear: both"></div>
				<div id="dialogBg"></div>
				<div id="dialog" class="animated">
					<div class="dialogTop">
						<a href="javascript:;" class="claseDialogBtn">关闭</a>
					</div>
					<form action="" method="post" id="editForm">
						<input type="hidden" name="id" id="a_id" value="">
						<input type="hidden" name="p_id" id="p_id" value="">
						<input type="hidden" name="s_id" id="s_id" value="">
						<ul class="editInfos">
							<li><label>留言</label>&nbsp;&nbsp;<textarea name="content" id="content" cols="60" rows="5" class="ipt-area"></textarea></li>
							<li><label>昵称</label>&nbsp;&nbsp;<input type="text" name="nickname" id="name" required value="" class="ipt" /></li>
							<li><label>邮箱</label>&nbsp;&nbsp;<input type="text" name="email" id="email" value="" class="ipt" /></li>
							<li><input type="button" value="提交" class="submitBtn" id="submitBtn" /></li>
						</ul>
					</form>
				</div>
				<div class="gbko">
					{foreach name="$comment_list" item="vo"}
					<div class="comment">
						<div class="imgdiv">
							<img class="imgcss"  src="__public__images/timg.jpg"/>
							<!--<!--<div class="imgcss" style="background-color:black;"></div>-->
						</div>
						<div class="conmment_details">
							<div style="float:left;">
								<span class="comment_name">{$vo.nickname} </span>     &nbsp;<span>{$vo.pub_time}</span>

							</div>
							<div class="del">
								<span  class="show_reply_list"><a href="javascript:;" onclick="test({$article.id},{$vo.id},{$vo.id})">回复</a></span>
							</div>
							<div class="comment_content" >
								{$vo.content}
							</div>
						</div>
						<div class="reply_list">
							{foreach name="$vo.user" item="kk"}
							<div class="reply" >
								<div class="imgdiv">
									<img class="imgcss"  src="__public__images/timg.jpg"/>
								</div>
								<div class="ff_conmment_details">
									<div style="float:left;">
										<span class="comment_name">{$kk.nickname} </span>     &nbsp;<span>{$kk.pub_time}</span>

									</div>
									<div class="del">
										<span  class="show_reply_list"><a href="javascript:;" onclick="test({$article.id},{$kk.id},{$vo.id})">回复</a></span>
									</div>
									<div class="reply_comment_content" >回复&nbsp;<span style="font-weight: bold">{$kk.user_name}</span>&nbsp;:&nbsp;&nbsp;
										{$kk.content}
									</div>
								</div>
							</div>
							{/foreach}
							<div class="reply"  style="display:none">
								<div class="imgdiv">
									<img class="imgcss"  src="__public__images/timg.jpg"/>
								</div>
								<div class="ff_conmment_details">
									<div style="float:left;">
										<span class="comment_name">小猪 </span>     &nbsp;<span>22分钟前</span>

									</div>
									<div class="del">
										<span  class="show_reply_list"><a href="javascript:;" onclick="test()">回复</a></span>
									</div>
									<div class="reply_comment_content" > 回复&nbsp;<span style="font-weight: bold">大白</span>&nbsp;: &nbsp;&nbsp;感觉林丹越来越帅了，好棒感觉林丹越来越帅了，好棒感觉林丹越来越帅了，好棒感觉林丹越来越帅了，
										好棒感觉林感觉林丹越来越帅了，好棒感觉林丹越来越帅了，好棒感觉林丹越来越帅了
									</div>
								</div>
							</div>
						</div>
					</div>
					{/foreach}
			</div>
		</div>
	</main>
	{include file="/right/right"}
</article>
{include file="/footer/footer"}
<a href="#" class="cd-top">Top</a>
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<script src="__public__js/jquery.js"></script>
<script src="__public__js/jquery_002.js"></script>
<script src="__public__js/hc-sticky.js"></script>
<script src="__public__js/comm.js"></script>
<script src="__public__js/scrollReveal.js"></script>
<script src="__public__js/jquery.share.min.js"></script>
<script src="__public__js/social-share.min.js"></script>
<script src="__public__layer/layer.js"></script>
<!--[if lt IE 9]>
<script src="/skin/show/js/modernizr.js"></script>
<![endif]-->
<script type="text/javascript">
    $(function(){
        $('#share').share({sites: ['qzone', 'qq', 'weibo','wechat']});
    });


    var w,h,className;
    function getSrceenWH(){
        w = $(window).width();
        h = $(window).height();
        $('#dialogBg').width(w).height(h);
    }

    window.onresize = function(){
        getSrceenWH();
    }
    $(window).resize();
    function test(id,a_id,s_id) {
        $("#a_id").attr("value",id);
        $("#p_id").attr("value",a_id);
        $("#s_id").attr("value",s_id);
        getSrceenWH();
        w = $(".gbko").width();
        className = $(this).attr('class');
        $('#dialogBg').fadeIn(300);
        $('#dialog').removeAttr('class').addClass('animated '+className+'').fadeIn();
        $('#dialog').width(w)
    }
    $('.claseDialogBtn').click(function(){
        $('#dialogBg').fadeOut(500,function(){
            $('#dialog').addClass('bounceOutUp').fadeOut();
            $("#a_id").attr("value","");
            $("#p_id").attr("value","");
            $("#s_id").attr("value","");
        });
    });


    //评论内容
	$("#submitBtn").click(function () {

        var _id      =  $("#a_id").val();
        var _pId     =  $("#p_id").val();
        var _sId     =  $("#s_id").val();
        var _content =  $("#content").val();
        var _name    =  $("#name").val();
        var _email   =  $("#email").val();
        /*if ( (_content=="") && (_name=="") ) {
            layer.msg('留言内容或者昵称不能为空！');
            return false;
		}*/
        var name =( _name != "")?_name:"匿名";
        $.ajax({
			type : "POST",
			url : "{:url('gb/add')}",
			data : {a_id:_id,content:_content,nickname:name,email:_email,p_id:_pId,s_id:_sId},
			success : function (res) {
				if ( res==1 ) {
                    layer.msg('评论成功！');
                    $('#dialogBg').fadeOut(500,function(){
                        $('#dialog').addClass('bounceOutUp').fadeOut();
                        $("#a_id").attr("value","");
                        $("#p_id").attr("value","");
                        $("#s_id").attr("value","");
                    });
                    window.location.reload();
				} else {
                    layer.msg('评论失败！');
				}
            }
		});
    });

</script>
</body>
</html>
